package OfferAliBaBa.b_23年数马笔试;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author WangYingLong
 */
public class Main1 {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        char[] array = reader.readLine().toCharArray();
        int count = 0;
        for (char c : array) {
            if (c - 'a' < 0) {
                count++;
            }
        }
        System.out.println(count);
    }
}
